<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserInfoInterestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //个人兴趣爱好
        Schema::create('user_info_interests', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->uuid ('id')->primary ('id');//uuid主键
            $table->uuid('info_id');
            $table->tinyInteger('interest');//兴趣爱好
            $table->timestamps();
            $table->foreign ('info_id')->references ('id')->on ('user_info')->onDelete ('cascade');//个人信息外键
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_info_interests');
    }
}
